//package com.example.springboot1.api;
//
//import com.example.springboot1.delay.RedisDelayQueueEnum;
//import com.example.springboot1.delay.RedisDelayQueueUtil;
//import com.example.springboot1.entity.DiseaseMapQuery;
//import com.example.springboot1.entity.IotTokenBo;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.servlet.http.HttpServletRequest;
//import java.math.BigDecimal;
//import java.util.HashMap;
//import java.util.Map;
//import java.util.concurrent.TimeUnit;
//import java.util.regex.Matcher;
//import java.util.regex.Pattern;
//
///**
// * @author ckj
// * @description TODO
// * @date 2022-06-15 15:53
// */
//
//@RestController
//public class TestApi {
//
//    @Autowired
//    private RedisDelayQueueUtil redisDelayQueueUtil;
//
//    @GetMapping("/delay")
//    public String delay(){
//        Map  map =new HashMap();
//        map.put("111","11");
//        redisDelayQueueUtil.addDelayQueue("ss", 10L, TimeUnit.SECONDS, RedisDelayQueueEnum.START.getCode());
//        redisDelayQueueUtil.addDelayQueue(map, 15L, TimeUnit.SECONDS, RedisDelayQueueEnum.FIX_TIMEOUT.getCode());
//        return "ok";
//    }
//    @GetMapping("/test")
//    public String test(Long id) {
//        String s = id.toString();
//        System.out.println(1);
//        return "{\"orgName\":\"渝黔高速\"}";
//    }
//
//
//
//
//
//
//
//    @PostMapping("/test1")
//    public String test1(DiseaseMapQuery query, HttpServletRequest request) {
//        String contentType = request.getContentType();
//        String orgId = query.getOrgId();
//        return "{\"success\":true,\"wrapList\":false,\"code\":0,\"msg\":\"操作成功\",\"data\":[{\"id\":\"1059921712486809600\",\"diseaseFrom\":1,\"diseaseFromChn\":\"日巡查\",\"lat\":29.504960,\"lng\":106.576979,\"diseaseCode\":\"CQ-JCBH-2301030001A\",\"name\":\"剥落、掉角\",\"recordId\":null,\"contructionId\":null,\"diseasePosition\":null,\"recordTime\":\"2023-01-03 19:50:27\",\"diseaseStatus\":\"草稿\",\"remark\":null,\"pushRecordTime\":null,\"responseTime\":null,\"maintainRecordTime\":null,\"maintainHour\":null,\"soName\":\"重庆公司\",\"sectionName\":\"测试路段\",\"param\":\"宽度:6m,长度:5m,数量:15处\",\"param0\":\"宽度:6m\",\"param1\":\"长度:5m\",\"param2\":\"数量:15处\",\"param3\":null,\"param4\":null,\"param5\":null},{\"id\":\"1059923146313826304\",\"diseaseFrom\":1,\"diseaseFromChn\":\"日巡查\",\"lat\":29.504963,\"lng\":106.576975,\"diseaseCode\":\"CQ-JCBH-2301030002A\",\"name\":\"空洞\",\"recordId\":null,\"contructionId\":null,\"diseasePosition\":null,\"recordTime\":\"2023-01-03 19:56:10\",\"diseaseStatus\":\"草稿\",\"remark\":null,\"pushRecordTime\":null,\"responseTime\":null,\"maintainRecordTime\":null,\"maintainHour\":null,\"soName\":\"重庆公司\",\"sectionName\":\"长寿支线\",\"param\":\"宽度:5m,长度:2m,数量:2处\",\"param0\":\"宽度:5m\",\"param1\":\"长度:2m\",\"param2\":\"数量:2处\",\"param3\":null,\"param4\":null,\"param5\":null}],\"dataList\":null}";
//    }
//
//    @GetMapping("/validToken")
//    public IotTokenBo validToken(String token) {
//        IotTokenBo tokenBo = new IotTokenBo();
//        tokenBo.setToken(token);
//        tokenBo.setScope("web");
//        tokenBo.setUserId("13184190208");
//        return tokenBo;
//    }
//
//    public static void main(String[] args) {
////        Integer a=360;
////        Integer count=0;
////        List<Integer> data = Arrays.asList(300, 500, 200);
////        data=data.stream().sorted().collect(Collectors.toList());
////        for (int i = data.size()-1; i >=0; i--) {
////
////            String b=i+"";
////            if(a>=data.get(i)){
////                 count=i+1;
////                 break;
////            }
////        }
////        System.out.println(count);
////
////        Long d=1150L;
////        long l = d / 60L;
////        System.out.println(l);
//
////        String format = String.format("%s-%03d", "111", 1);
////        System.out.println(format);
////        List<String> numbers= Arrays.asList("111-002","111-009");
////        Integer num = numbers.stream().map(n -> n.replaceAll("111" + "-", "")).map(Integer::parseInt).max((n1, n2) -> n1 - n2).get();
////        String format1 = String.format("%s-%03d", "111", num + 1);
////        System.out.println(format1);
//
//        BigDecimal result = new BigDecimal("1").divide(new BigDecimal("3"), 1, BigDecimal.ROUND_HALF_DOWN);
//        System.out.println(result);
//        String userName = "s";
//        String regex1 = "^(http[s]?://)?((?:[0-9]{1,3}\\.){3}[0-9]{1,3}|(?:[a-zA-Z\\-]+\\.)+[a-zA-Z]{2,})(?::[0-9]{1,5})?$";
//        String url = "http://127.0.0.1:8080/path/to/resource";
//
//        String regex = "(https?|ftp)://([a-zA-Z0-9.-]+)(?::\\d+)?";
//        Pattern pattern = Pattern.compile(regex);
//
//        Matcher matcher = pattern.matcher(url);
//        if (matcher.find()) {
//            String replacedUrl = matcher.replaceAll("");
//            System.out.println("Replaced URL: " + replacedUrl);
//        } else {
//            System.out.println("URL does not match the pattern");
//        }
//    }
//}
//
//
